package com.example.springdata.mapper;

import com.example.springdata.dto.UserDto;
import com.example.springdata.entity.User;
import com.example.springdata.vo.UserVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @description:
 * @version:
 * @Author: Huang
 * @date: 2025-03-25
 */
@Mapper
public interface UserMapper {
    UserMapper INSTANCE = Mappers.getMapper(UserMapper.class);

    @Mappings({@Mapping(target = "name", source = "name"), @Mapping(target = "id", source = "id")})
    UserVo toUserVo(User user);


    @Mappings({@Mapping(target = "name", source = "name"), @Mapping(target = "id", source = "id")})
    UserDto toUserDto(User user);
}
